@extends('admin.public.layout')
@section('title', '新增菜单')

@section('css')

@endsection

@section('content')
    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-body">
                    <form action="{{url('admin/menu/add')}}" method="post">
                        <div class="form-group">
                            <label for="example-text-input"><span style="color:red;">*</span>&nbsp;菜单名称</label>
                            <input class="form-control" type="text" name="menu_name" placeholder="请输入菜单名称" value="">
                        </div>
                        <div class="form-group">
                            <label for="example-text-input"><span style="color:red;">*</span>&nbsp;父类菜单</label>
                            <select class="form-control" id="example-select" name="pid" size="1">
                                <option value="0">顶级菜单</option>
                                @foreach($menu_list as $k=>$v)
                                    <option value="{{$v['id']}}">{{$v['menu_name']}}</option>
                                    @isset($v['child'])
                                        @foreach($v['child'] as $ck=>$cv)
                                            <option value="{{$cv['id']}}">&nbsp;&nbsp;&nbsp;&nbsp;{{$cv['menu_name']}}</option>
                                        @endforeach
                                    @endisset
                                @endforeach
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="example-text-input">&nbsp;菜单图标</label>
                            <input class="form-control" type="text" name="icon" placeholder="请输入菜单图标" value="">
                        </div>
                        <div class="form-group">
                            <label for="example-text-input">&nbsp;菜单路径</label>
                            <input class="form-control" type="text" name="route" placeholder="请输入菜单路径" value="">
                        </div>
                        <div class="form-group">
                            <label for="example-text-input">&nbsp;是否显示</label>
                            <div class="col-xs-12">
                                <label class="lyear-switch switch-solid switch-success">
                                    <input type="checkbox" name="is_show" value="1" checked>
                                    <span></span>
                                </label>
                            </div>

                        </div>
                        <div class="form-group">
                            <label for="example-text-input">&nbsp;排序</label>
                            <input class="form-control" type="number" name="sortby" placeholder="请输入排序" value="20" max="5">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-primary submitForm" type="button">保存</button>
                            <button class="btn btn-secondary" type="button" onclick="layer.closeAll();">关闭</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('js')
    <script type="text/javascript" src="{{asset('static/js/chosen.jquery.min.js')}}"></script>
    <script type="text/javascript">
        $(function(){

        });
    </script>
@endsection